package cn.entergx.smallmengplan

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Toast
import cn.entergx.smallmengplan.widget.MyImageView
import kotlinx.android.synthetic.main.activity_main.*
import java.util.*

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        val m = 1000*60*60*24
//        Timer().schedule(object :TimerTask(){
////            override fun run() {
////                val currentTimeMillis = System.currentTimeMillis()
////                val day = (currentTimeMillis - 1630156095000)/m
////                runOnUiThread {
////                    tv_day.text = day.toString()+":"+currentTimeMillis -day*
////                }
////            }
////        },1000)
        val currentTimeMillis = System.currentTimeMillis()
        val day = (currentTimeMillis - 1630156095000)/m
        tv_day.text = day.toString()
        miv.setOnSlideListener(object : MyImageView.OnSlideListener {
            override fun onSlide() {
                startActivity(Intent(this@MainActivity,ListActivity::class.java))
            }
        })
    }
}